package com.sx.zongzhi.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by XZY on 2017/12/5.
 * 诉求列表bean
 */

public class AppealBean implements Serializable {


    /**
     * page : 1
     * records : 1
     * rows : []
     * total : 1
     */

    private int page;
    private int records;
    private int total;
    private List<RowsBean> rows;
    private PermissionBean permission;

    public PermissionBean getPermission() {
        return permission;
    }

    public void setPermission(PermissionBean permission) {
        this.permission = permission;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRecords() {
        return records;
    }

    public void setRecords(int records) {
        this.records = records;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public List<RowsBean> getRows() {
        return rows;
    }

    public void setRows(List<RowsBean> rows) {
        this.rows = rows;
    }

    public static class RowsBean implements Serializable{
        /**
         * appealId :
         * appealState:
         * appealType : {}
         * beAccepted : false
         * description : 53253253532
         * appealId : 5C59167B4FA84F05B05FA3AC24FB4554
         * name : 43432432
         * occurrenceTime : 2017-11-20 00:00:00
         * sourceUserName : 超级管理员
         * sourcesWay :办理来源状态(30, “交办”,50, “抄告”,70, “回退”,90, “分流”)
         */

        private String appealId;
        private int appealState;
        private AppealTypeBean appealType;
        private boolean beAccepted;
        private String description;
        private String name;
        private String occurrenceTime;
        private String sourceUserName;
        private String stepRecordId;
        private int sourcesWay;

        public int getSourcesWay() {
            return sourcesWay;
        }

        public void setSourcesWay(int sourcesWay) {
            this.sourcesWay = sourcesWay;
        }

        public AppealTypeBean getAppealType() {
            return appealType;
        }

        public void setAppealType(AppealTypeBean appealType) {
            this.appealType = appealType;
        }

        public boolean isBeAccepted() {
            return beAccepted;
        }

        public void setBeAccepted(boolean beAccepted) {
            this.beAccepted = beAccepted;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public String getAppealId() {
            return appealId;
        }

        public void setAppealId(String appealId) {
            this.appealId = appealId;
        }

        public int getAppealState() {
            return appealState;
        }

        public void setAppealState(int appealState) {
            this.appealState = appealState;
        }

        public String getStepRecordId() {
            return stepRecordId;
        }

        public void setStepRecordId(String stepRecordId) {
            this.stepRecordId = stepRecordId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getOccurrenceTime() {
            return occurrenceTime;
        }

        public void setOccurrenceTime(String occurrenceTime) {
            this.occurrenceTime = occurrenceTime;
        }

        public String getSourceUserName() {
            return sourceUserName;
        }

        public void setSourceUserName(String sourceUserName) {
            this.sourceUserName = sourceUserName;
        }

        public static class AppealTypeBean implements Serializable{
            /**
             * dictId : 25C7609B616642DAB0ED718B2FCC4737
             * domainId : DE88F3F56FFB4486BAF498462916B285
             * domainName : 群防群治
             * dictName : 治安防范
             */

            private String dictId;
            private String domainId;
            private String domainName;
            private String dictName;

            public String getDictId() {
                return dictId;
            }

            public void setDictId(String dictId) {
                this.dictId = dictId;
            }

            public String getDomainId() {
                return domainId;
            }

            public void setDomainId(String domainId) {
                this.domainId = domainId;
            }

            public String getDomainName() {
                return domainName;
            }

            public void setDomainName(String domainName) {
                this.domainName = domainName;
            }

            public String getDictName() {
                return dictName;
            }

            public void setDictName(String dictName) {
                this.dictName = dictName;
            }
        }
    }

    public static class PermissionBean implements Serializable{
        private boolean expeditedAppealHandle;//加急
        private boolean ordinarySupervise;//普通督办权限(true:有,false:无)
        private boolean redSupervise; //红牌督办
        private boolean instructionsAppealHandle;//批示权限
        private boolean yellowSupervise;//黄牌督办

        public boolean isExpeditedAppealHandle() {
            return expeditedAppealHandle;
        }

        public void setExpeditedAppealHandle(boolean expeditedAppealHandle) {
            this.expeditedAppealHandle = expeditedAppealHandle;
        }

        public boolean isOrdinarySupervise() {
            return ordinarySupervise;
        }

        public void setOrdinarySupervise(boolean ordinarySupervise) {
            this.ordinarySupervise = ordinarySupervise;
        }

        public boolean isRedSupervise() {
            return redSupervise;
        }

        public void setRedSupervise(boolean redSupervise) {
            this.redSupervise = redSupervise;
        }

        public boolean isInstructionsAppealHandle() {
            return instructionsAppealHandle;
        }

        public void setInstructionsAppealHandle(boolean instructionsAppealHandle) {
            this.instructionsAppealHandle = instructionsAppealHandle;
        }

        public boolean isYellowSupervise() {
            return yellowSupervise;
        }

        public void setYellowSupervise(boolean yellowSupervise) {
            this.yellowSupervise = yellowSupervise;
        }
    }


    public List<String> getPermissionList(){
        List<String> permissionList=new ArrayList<>();
        if (this.permission.expeditedAppealHandle){
            permissionList.add("加急");
        }
        if (this.permission.instructionsAppealHandle){
            permissionList.add("领导批示");
        }
        if (this.permission.ordinarySupervise){
            permissionList.add("普通督办");
        }
        if (this.permission.yellowSupervise){
            permissionList.add("黄牌督办");
        }
        if (this.permission.redSupervise){
            permissionList.add("红牌督办");
        }
        return permissionList;
    }

}
